Skip to content

Preserve download destination until decryption and decompression succeed - #56

Open
CooperBigFoot wants to merge 1 commit into
ebics-java:masterfrom
CooperBigFoot:fix/preserve-download-destination
Open

CooperBigFoot wants to merge 1 commit into
ebics-java:masterfrom
CooperBigFoot:fix/preserve-download-destination

Conversation

@CooperBigFoot

Copy link
Copy Markdown
Contributor

FileTransfer.fetchFile currently opens the destination before decoding the downloaded content. A decryption or decompression failure can therefore erase an existing file or leave a new empty file.

  • Decode into memory before opening the destination; keep public signatures and EBICS messages unchanged.
  • Add regression tests for decryption failure, malformed compressed data, an absent destination, and successful replacement.

Validation: Java 17, ./mvnw -Dtest=FileTransferTest test and ./mvnw verify. Three regression tests fail on the original code; all four pass with the fix.

This adds one in-memory payload buffer. It does not make filesystem writes atomic or protect against disk-write failures. Destination write failures now propagate as the already-declared IOException, rather than being wrapped by Joiner in EbicsException.

Prepared with AI assistance, with human review before publication. I have six months of top-tier Google model access for research and am investing that opportunity in verified open-source contributions. Related to #54.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant